package com.itheima.app.controller;
import com.itheima.app.config.R;
import com.itheima.app.config.R1;
import com.itheima.app.service.SetmealService;
import com.itheima.health.model.pojos.Setmeal;
import com.itheima.health.model.vos.SetmealVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {
    @Autowired
    private SetmealService setmealService;

    @GetMapping("/getAllSetmeal")
    public R1<List<SetmealVO>> getAllSetmeal() {
        List<SetmealVO> list = setmealService.getAllSetmeal();
        return R1.success(list);
    }

    @PostMapping("/findById")
    public R<Setmeal> findById(Integer id) {
        Setmeal ss =setmealService.findById(id);
        return R.success(ss);


    }
}
